package com.powerunion.datacollection.persistence.db;

import java.sql.*;

import org.apache.log4j.Logger;

import com.powerunion.datacollection.util.DBUtil;
import com.powerunion.util.log.LogHelper;

public class ConnectionFactory {
	private static final Logger logger = LogHelper.getInstance().getLogger(
			ConnectionFactory.class);

	private static ConnectionFactory instance = null;
	private DBUtil dbUtil = null;
	
	public static ConnectionFactory getInstance(){
		if(instance == null){
			instance = new ConnectionFactory();
		}
		return instance;
	}
	
	private ConnectionFactory(){
		this.dbUtil = new DBUtil();
	}

  public Connection getConncetion() throws
      ConnectionException,SQLException {
   
    return dbUtil.getConnection();
  }

}
